home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Code Samples / untested / tcpip / ifish / connect.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  569 b   |  29 lines  |  [TEXT/ttxt]

  1. --<<<
  2.  
  3. in module InternetFish
  4.  
  5. -- Connection class
  6.  
  7. class connection ()
  8. instance variables
  9.     tcpStream
  10.     host
  11.     port
  12.     client
  13.     mqueue
  14. end
  15.  
  16. method init self {object connection} #rest args #key tcpStream: host: port: client: -> (
  17.     apply nextmethod self args
  18.     self.host := host
  19.     self.port := port
  20.     self.client := client
  21.     if tcpStream != unsupplied do 
  22.         openConnection self tcpstream
  23. )
  24.  
  25. method openConnection self  {object connection} tcpStream -> (
  26.     self.tcpStream := tcpStream
  27.     self.mqueue := new MessageQueue fun: handleMessage client: self.client stream: self.tcpStream
  28. )
  29.